<template>
    <h1>手写Promise</h1>
</template>
    
<script setup>
import { onMounted } from 'vue';
import Promise from './Promise.js'

onMounted(() => {
    const p1 = new Promise((resolve, reject) => {
        setTimeout(() => {
            reject('success1')
        }, 500);
    })
    const p2 = new Promise((resolve, reject) => {
        setTimeout(() => {
            reject('success2')
        }, 1000);
    })
    Promise.any([p1, p2]).then(res => {
        console.log(res)
    })
})
</script>
    
<style lang="scss" scoped>
</style>